home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / !applications! / symphonie / dsplugin / dspplugin mvolume.s < prev    next >
Text File  |  1994-04-11  |  3KB  |  171 lines

  1.  
  2.     MC68020
  3.  
  4. SST_SYS_GetMem            EQU    0
  5. SST_SYS_FreeMem            EQU    4
  6.  
  7. SST_FILE_RequestFileName    EQU    100
  8. SST_FILE_SetReqPattern        EQU    104
  9. SST_FILE_SetReqDir        EQU    108
  10. SST_FILE_GetFileName        EQU    112
  11. SST_FILE_GetFileLen        EQU    116
  12.  
  13. SST_GFX_AssistText        EQU    200
  14. SST_GFX_AssistDecLong        EQU    204
  15. SST_GFX_AssistDecByte        EQU    208
  16. SST_GFX_AssistHexLong        EQU    212
  17.  
  18. SST_AUDIO_GetChunkLen        EQU    400
  19.  
  20. SST_PTR_EXECBASE        EQU    1600
  21. SST_PTR_INTBASE            EQU    1604
  22. SST_PTR_DOSBASE            EQU    1608
  23. SST_PTR_ASLBASE            EQU    1612
  24. SST_PTR_REQTOOLSBASE        EQU    1616
  25. SST_PTR_GFXBASE            EQU    1620
  26.  
  27. SST_PTR_Screen            EQU    1650
  28.  
  29. SST_ADR_ProcessorFlags        EQU    1800
  30. SST_ADR_SystemFrequency        EQU    1804
  31. SST_ADR_SystemBpm        EQU    1808
  32. SST_ADR_ChunkLen        EQU    1812
  33. SST_ADR_OversampleFlag        EQU    1816
  34.  
  35.  
  36.     dc.b    "Symphonie DSP Plugin"    ;MAGIC String    (PRIVATE)
  37.     dc.w    1,0            ;Version,Release (PRIVATE,DO NOT CHANGE)
  38.  
  39.     ;- DSPLIB -------------------------------------------------
  40.  
  41.     jmp    InitDSP(PC)        ;Allocate Mem, Build your Tables
  42.     jmp    CleanUpDSP(PC)        ;Free Mem
  43.  
  44.     jmp    ProcDsp(PC)        ;Process DSP algorithm (interrupt)
  45.  
  46.     jmp    GetDspTitle(PC)        ;Get DSP algorithm Title
  47.     jmp    ModifyValue(PC)        ;notify changed Value
  48.  
  49.     jmp    GraphSizeModify(PC)    ;notify graph size has changed
  50.     jmp    RefreshGraph(PC)    ;notify its time for a GFX update
  51.  
  52.     jmp    StartDSP(PC)        ;notify start
  53.     jmp    StopDSP(PC)        ;notify stop
  54.     dc.l    -1
  55.  
  56.     ;- CODE --------------------------------------------------
  57.  
  58.  
  59. StartDSP
  60.     rts
  61.  
  62. StopDSP
  63.     rts
  64.  
  65. GraphSizeModify
  66.     rts
  67.  
  68. RefreshGraph
  69.     rts
  70.  
  71. ModifyValue    ;INPUT (D0L,D1L)(VALUE, PARAMETER ID)
  72.     lea.l    Volume(PC),a0
  73.     move.l    d0,(a0)
  74.  
  75.     move.l    #SST_GFX_AssistHexLong,d7
  76.     bsr    GoSST
  77.  
  78.     move.l    #SST_GFX_AssistDecLong,d7
  79.     bsr    GoSST
  80.  
  81.     rts
  82.  
  83. Volume    dc.l    256
  84.  
  85. GoSST    move.l    a6,-(sp)
  86.     move.l    SUPERSTBASE(PC),a6
  87.     move.l    (a6,d7.w),a6
  88.     jsr    (a6)
  89.     move.l    (sp)+,a6
  90.     rts
  91.  
  92.  
  93. InitDSP        ;I(A0L)(SUPERSUPPORTTABLE_PTR)
  94.         ;O(A0L)(DSPGUI_PTR)
  95.  
  96.     lea.l    SUPERSTBASE(PC),a1
  97.     move.l    a0,(a1)
  98.  
  99.     lea.l    Welcome_TXT(PC),a0
  100.     move.l    #SST_GFX_AssistText,d7
  101.     bsr    GoSST
  102.  
  103.  
  104.  
  105.  
  106.     lea.l    Parameter_DEF(PC),a0
  107.     rts
  108.  
  109. CleanUpDSP    rts
  110.  
  111. GetDspTitle    ;OUTPUT (A0L)(DSPTitle_TXT)
  112.     lea.l    DSPTitle(PC),a0
  113.     rts
  114.  
  115. ProcDsp        ;INPUT (D0W,A1L)(SAMPLE_NUMB,SAMPLECHUNK_PTR)
  116.     movem.l    d0-a6,-(sp)
  117.  
  118.     move.l    Volume(PC),d3
  119.     andi.l    #$fff,d3
  120.  
  121.     subq.w    #1,d0
  122.  
  123. .loop
  124.     move.l    (a1),d1
  125.  
  126.     move.l    d1,d2
  127.     swap    d1
  128.  
  129.     muls    d3,d2
  130.     asr.l    #8,d2
  131.  
  132.     muls    d3,d1
  133.     asr.l    #8,d1
  134.  
  135.     swap    d1
  136.  
  137.     move.w    d2,d1
  138.  
  139.     move.l    d1,(a1)+
  140.     dbf    d0,.loop
  141.  
  142.  
  143.     movem.l    (sp)+,d0-a6
  144.     rts
  145.  
  146.  
  147.  
  148.     ;- GUI ------------------------------------------------------
  149.  
  150.     even
  151. Parameter_DEF
  152.     dc.b    "Volume",0    ;PARAMETER TITLE (C STRING)
  153.     dc.b    0,0,1,0        ;Init (LONG)
  154.     dc.b    0,0,0,0        ;Min (LONG)
  155.     dc.b    0,0,1,0        ;Max (LONG)
  156.  
  157.  
  158.     dc.b    0        ;END OF GUI DEF
  159.  
  160.     ;- TITLE ----------------------------------------------------
  161.  
  162.  
  163.         dc.b    "$VER: "
  164. DSPTitle    dc.b    "Test Dsp Plugin v1.0",0
  165. Welcome_TXT    dc.b    "Welcome to DSP test",0
  166.  
  167.         even
  168. SUPERSTBASE    dc.l    0
  169. test        dc.l    0
  170.     END
  171.